#include "StdAfx.h"
#include "Note.h"

// definition

#include "Note.h"


Note::Note(float note, int coef) :_valeur (note),_coef ( coef)
{
}


Note::~Note(void)
{
}

float Note::GetValeur() const
{
	return _valeur;
}

void Note::SetValeur(float Val)
{
	_valeur=Val;
	if(_valeur<0) _valeur=0;
	else if(_valeur>20) _valeur=20;
}
		
unsigned Note::GetCoef() const
{
	return _coef;
}

void Note::SetCoef(unsigned Coef)
{
	_coef=Coef;
	if(_coef==0) _coef=1;
}


string Note::ToString() const {
	stringstream s ;
	s << _valeur << "/20 (" << _coef << ")";

	return s.str();
}

ANote* Note::HeapClone() const{
	return new Note(_valeur,_coef);
}